package com.zhb.lkd.controller;


import com.zhb.lkd.base.PageResponse;
import com.zhb.lkd.base.ResponseResult;
import com.zhb.lkd.service.IVendingMachineService;
import com.zhb.lkd.service.IVmTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author haibin
 * @since 2024-08-18
 */
@RestController
@RequestMapping("/api/vm-service/vm")
@Slf4j
@Api(tags = "设备管理相关接口")
public class VendingMachineController {
    @Resource
    private IVendingMachineService vendingMachineService;

    @GetMapping("/search")
    @ApiOperation("设备搜索")
    public ResponseResult search(
            @RequestParam(defaultValue = "1") Integer pageIndex,
            @RequestParam(defaultValue = "10") Integer pageSize, String innerCode) {
        log.info("设备搜索{}", innerCode);
        PageResponse pageResponse = vendingMachineService.search(pageIndex, pageSize, innerCode);
        return ResponseResult.ok(pageResponse);
    }
}
